package com.mallcloud.mall.mall.api.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;

@ApiModel(value = "MallPointsDiscountRuleModel", description = "积分抵扣规则")
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("V_ZHTC_JFHS")
public class MallPointsDiscountRuleModel implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("手机号")
    @TableField("cdemobile")
    private String mobile;

    @ApiModelProperty("卡号")
    @TableField("cdmno")
    private String cardNo;

    @ApiModelProperty("用户积分余额")
    @TableField("cdmjfye")
    private BigDecimal pointsBalance;

	/**
	 * 积分抵扣规则: 每redeemPoints积分可抵扣redeemMoney元
	 */
	@ApiModelProperty("兑换积分")
    @TableField("cjsjf")
    private BigDecimal redeemPoints;

    @ApiModelProperty("兑换金额")
    @TableField("cjsje")
    private BigDecimal redeemMoney;

    @ApiModelProperty("兑换1元需要多少积分")
    @TableField("hsjf")
    private BigDecimal ruleAmount;

    @TableField(exist = false)
	@ApiModelProperty("积分抵扣规则")
	private String description;

	public String getDescription() {
		return description = String.format("积分抵扣规则: 每%s积分可抵扣%s元", this.redeemPoints, this.redeemMoney);
	}
}
